<?php

/**
 * sfGuardUser filter form.
 *
 * @package    GREEN_LIGHT
 * @subpackage filter
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrinePluginFormFilterTemplate.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class sfGuardUserFormFilter extends PluginsfGuardUserFormFilter
{
  public function configure()
  {
	  foreach($this->getWidgetSchema()->getFields() as $name=>$widget)
	  {
		if ($name == 'first_name' || $name == 'last_name') 
		{
			$this->widgetSchema[$name] = new sfWidgetFormFilterInput(array('with_empty' => false));
		}
		
		if ($name == 'is_active' || $name == 'is_super_admin')
		{
			$this->widgetSchema[$name] = new sfWidgetFormChoice(array('choices' => array('' => 'Có/Không', 1 => 'có', 0 => 'không')));
		}
		
		if ($name == 'created_at' || $name == 'updated_at' || $name == 'last_login')
		{
			$this->widgetSchema[$name] = new sfWidgetFormFilterDate(array('from_date' => new sfWidgetFormDate(array('format' => '%day% %month% %year%')), 'to_date' => new sfWidgetFormDate(array('format' => '%day% %month% %year%')), 'with_empty' => false, 'template' => '<div style="width:50px;padding:5px 0;">từ</div> %from_date%<br /><div style="width:50px;padding:5px 0;">đến</div> %to_date%'));
		}
	  }
  }
}
